/**
 * Copyright (c) 2015 Baidu. All Rights Reserved.
 *
 * @file 文件操作单测
 * @author yuanguozheng
 */
var fileutil = require('../utils/fileutil');
var path = require('path');

exports.testCreateBase = function (test) {
    test.notEqual(null, fileutil.createBase());
    test.done();
};

exports.testMkDir = function (test) {
    var testDir = path.join(__dirname, '../testDir');
    test.equal(true, fileutil.mkdir(testDir));
    test.equal(false, fileutil.mkdir(null));
    test.done();
};

exports.testWriteToFile = function (test) {
    var testDir = path.join(__dirname, '../testDir');
    var testFile = '1.txt';
    test.equal(true, fileutil.writeToFile(testDir, testFile, 'test'));
    test.equal(false, fileutil.writeToFile(null, null, null));
    test.done();
};